home *** CD-ROM | disk | FTP | other *** search
/ Cream of the Crop 26 / Cream of the Crop 26.iso / os2 / plnk081.zip / pilot-link.0.8.1 / Java / Pdapilot / address / AppBlock.java next >
Encoding:
Java Source  |  1997-08-05  |  1.1 KB  |  54 lines

  1.  
  2. package Pdapilot.address;
  3.  
  4. import java.io.*;
  5.  
  6. public class AppBlock extends Pdapilot.CategoryAppBlock {
  7.     public boolean sortByCompany;
  8.     public int country;
  9.     public String[] label;
  10.     public String[] phoneLabel;
  11.     public int[] labelRenamed;
  12.         
  13.     public AppBlock() {
  14.         super();
  15.     }
  16.         
  17.     public AppBlock(byte[] contents) {
  18.         super(contents);
  19.     }
  20.     
  21.     public native void unpack(byte[] data);
  22.     public native byte[] pack();
  23.     
  24.     public void fill() {
  25.         sortByCompany = false;
  26.         country = 0;
  27.         label = new String[22];
  28.         phoneLabel = new String[8];
  29.     }
  30.         
  31.     public String describe() {
  32.         StringBuffer c = new StringBuffer("labels=[");
  33.         for(int i=0;i<label.length;i++) {
  34.             if (i>0)
  35.                 c.append(",");
  36.             c.append(label[i]);
  37.         }
  38.         c.append("], phoneLabel=[");
  39.         for(int i=0;i<phoneLabel.length;i++) {
  40.             if (i>0)
  41.                 c.append(",");
  42.             c.append(phoneLabel[i]);
  43.         }
  44.         c.append("], labelRenamed=[");
  45.         for(int i=0;i<labelRenamed.length;i++) {
  46.             if (i>0)
  47.                 c.append(",");
  48.             c.append(labelRenamed[i]);
  49.         }
  50.         c.append("], sortByCompany="+sortByCompany+", country="+country);
  51.         return "" + c + ", " + super.describe();
  52.     }
  53. }
  54.